/*
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-06-08 18:30:18
 * @LastEditors: voanit
 * @LastEditTime: 2022-06-08 18:32:52
 */

export const highLight = (str: string, key: string) => {
  // let str = 'React hello  React'
  // let reg = new RegExp('react', 'gi')
  let reg = new RegExp(key, 'gi')
  return str.replace(reg, (res) => {
    return `<span>${res}</span>`
  })

}